package com.xq.spring.postprocess.container;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.core.Ordered;

/**
 * 容器后处理器.
 * 
 * @author 郭凯强
 */
public class CustomBeanFactoryPostProcessor implements
		BeanFactoryPostProcessor, Ordered {
	private final Marker marker = MarkerFactory
			.getMarker("BeanFactoryPostProcessor");
	private final Logger logger = LoggerFactory
			.getLogger(CustomBeanFactoryPostProcessor.class);

	@Override
	public void postProcessBeanFactory(
			ConfigurableListableBeanFactory beanFactory) {
		logger.debug(
				marker,
				"\r\nSpring容器是{},[DOC]All bean definitions will have been loaded, but no beans will have been instantiated yet",
				beanFactory);
	}

	@Override
	public int getOrder() {
		logger.debug(marker, "{}值越小优先级越高!", "order");
		return 100;
	}

}
